package com.wm.android.mydemos.activities.mediaplayerexample;

import com.wm.android.mydemos.R;

import android.app.Fragment;
import android.os.Bundle;
import android.os.Environment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.MediaController;
import android.widget.VideoView;

public class LocalVideoFragment extends Fragment {

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

		View mView = inflater.inflate(R.layout.mediaplayerexample_fragment, container, false);

		VideoView mVideoView = (VideoView) mView.findViewById(R.id.videoscreen);
		mVideoView.setVideoPath(Environment.getExternalStorageDirectory() + "/video.mp4");
		MediaController mController = new MediaController(getActivity());
		mVideoView.setMediaController(mController);
		mController.setMediaPlayer(mVideoView);

		return mView;
	}

}
